<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Vue-01</title>
</head>

<body>
    <div id="app">

        <textarea v-model="nickname" style="width:500px;height:500px;float: left;"></textarea>
        <div v-html="nickname" style="float: right;border:1px solid red;width:500px;height:500px;"></div>

    </div>
    <script src="js/vue.js"></script>
    <script>
        Vue.config.devtools = false
        Vue.config.productionTip = false
        let vm = new Vue({
            el: "#app",
            mounted() {
                this.str = this.str.replace(/ /g, "")
                let i = 0
                var timer = setInterval(() => {
                    this.nickname += this.str[i++]
                    if (i === this.str.length)
                        clearInterval(timer)
                }, 100)
            },
            data: {
                nickname: "",
                str: `123`
            },
            methods: {

            }
        })

        // setTimeout(function(){
        //     vm.$mount("#app")
        // },1000)
    </script>

</body>

</html>